package com.ruoyi.sale.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sale.mapper.SaleOrderDetailMapper;
import com.ruoyi.sale.domain.SaleOrderDetail;
import com.ruoyi.sale.service.ISaleOrderDetailService;

/**
 * 销售订单明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-09-02
 */
@Service
public class SaleOrderDetailServiceImpl implements ISaleOrderDetailService 
{
    @Autowired
    private SaleOrderDetailMapper saleOrderDetailMapper;

    /**
     * 查询销售订单明细
     * 
     * @param id 销售订单明细主键
     * @return 销售订单明细
     */
    @Override
    public SaleOrderDetail selectSaleOrderDetailById(Long id)
    {
        return saleOrderDetailMapper.selectSaleOrderDetailById(id);
    }

    /**
     * 查询销售订单明细列表
     * 
     * @param saleOrderDetail 销售订单明细
     * @return 销售订单明细
     */
    @Override
    public List<SaleOrderDetail> selectSaleOrderDetailList(SaleOrderDetail saleOrderDetail)
    {
        return saleOrderDetailMapper.selectSaleOrderDetailList(saleOrderDetail);
    }

    /**
     * 新增销售订单明细
     * 
     * @param saleOrderDetail 销售订单明细
     * @return 结果
     */
    @Override
    public int insertSaleOrderDetail(SaleOrderDetail saleOrderDetail)
    {
        return saleOrderDetailMapper.insertSaleOrderDetail(saleOrderDetail);
    }

    /**
     * 修改销售订单明细
     * 
     * @param saleOrderDetail 销售订单明细
     * @return 结果
     */
    @Override
    public int updateSaleOrderDetail(SaleOrderDetail saleOrderDetail)
    {
        return saleOrderDetailMapper.updateSaleOrderDetail(saleOrderDetail);
    }

    /**
     * 批量删除销售订单明细
     * 
     * @param ids 需要删除的销售订单明细主键
     * @return 结果
     */
    @Override
    public int deleteSaleOrderDetailByIds(Long[] ids)
    {
        return saleOrderDetailMapper.deleteSaleOrderDetailByIds(ids);
    }

    /**
     * 删除销售订单明细信息
     * 
     * @param id 销售订单明细主键
     * @return 结果
     */
    @Override
    public int deleteSaleOrderDetailById(Long id)
    {
        return saleOrderDetailMapper.deleteSaleOrderDetailById(id);
    }

    /**
     * @description: 根据订单号查询订单明细
     * @param: id
     * @return: com.ruoyi.common.core.web.domain.AjaxResult
     * @author clqlongbao
     * @date: 2022/9/2 22:47
     */
    @Override
    public List<SaleOrderDetail> selectSaleOrderdetailByOrderNo(Long orderNo) {
        return saleOrderDetailMapper.selectSaleOrderdetailByOrderNo(orderNo);
    }
}
